<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function ClaimEnq1(&$ParamRec, &$Data, &$q, &$UE_Opts) {
    //
    $Text = $ParamRec[0];
    $Type = $ParamRec[1];
    $FieldVals = $ParamRec[2];
    $VText = $ParamRec[3];
    $Default = $ParamRec[4];
    parse_str($ParamRec[5], $Options);
    $VOpts = $ParamRec[6];
    $ShortName = $ParamRec[7];
    if ($ShortName === null || $ShortName === "") {
        $ShortName = $Text;
    }
    $FieldName = $ParamRec[9];
    if ($FieldName) {
        $FieldVal = $Data[$q];
    } else {
        $FieldVal = "";
    }
    //
    $Exit = $UE_Opts['Exit'];
    //$Trace = $UE_Opts['Trace'];
    //
    if ($Trace) {
        print "<br> - q=" . $q . " FieldName=" . $FieldName . " FieldVal=" . $FieldVal . " Exit=" . $Exit;
    }
    switch ($Exit) {
        Case "A":
            //at very start
            break;
        Case "E":
            //before field entry/import
            switch ($FieldName) {
                case "StatusDate":
                    break;
                case "NextActDate":
                    break;
                default:
                    //$FieldVal = "";
                    break;
            }
            break;
        Case "F":
            if ($Trace) {
                print "<br>field name=" . $FieldName . ", val=" . $FieldVal;
            }
            //after field entry/import
            switch ($FieldName) {
                case "Division":
                    //print "case Division";
                    $FieldVal = "T";
                    break;
                case "ClientID":
                    $_SESSION['Work']['ClientID'] = $FieldVal;
                    //print $FieldVal;
                    break;
                case "claims.ID":
                    $_SESSION['Work']['ClaimID'] = $FieldVal;
                    break;
                default:
                    $FieldVal = "";
                    break;
            }
            break;
        default:
            //do nothing!
            break;
    }
//
    if ($Trace) {
        print "<br>Work = ";
        var_dump($_SESSION['Work']);
        print "<br>Data = ";
        var_dump($Data);
        return $FieldVal;
    }
}

?>
